<template name="index">
	<view>
		<cu-custom bgColor="bg-gradual-pink" ><block slot="content">热门直播</block></cu-custom>
		<room :roomlist="roomlist"></room>
		<view class="text-center" style="padding-top: 200rpx;" v-if="roomlist.length==0">
			<image style="width: 210rpx;height: 230rpx;opacity: 0.6;" src="../../static/empty2.png" mode=""></image>
			<view class="text-gray padding-top-lg">
				暂无数据
			</view>
		</view>
	</view>
</template>

<script>
	import room from '@/components/room-list.vue';
	export default {
		components:{
			room
		},
		name: "index",
		data() {
			return {
				lifeUrl:'rtmp://120.24.176.26:1935/live/room1',
				roomlist:[]
			};
			
		},
		onShow() {
			console.log("success")
		},
		created() {
			this.getroomlist()
		},
		methods:{
			statechange(e){
				console.log(e)
			},
			error(e){
				console.log(e)
			},
			goplay(){
				uni.navigateTo({
					url:'/pages/play/play'
				})
			},
			getroomlist(){
				this.util.csAjax('/addons/live/api.room/index',{},(ret)=>{
					console.log(ret)
					this.roomlist = ret.data
				})
			}
		}
	}
</script>

<style>
	.page {
		height: 100vh;
	}
	
	
	
</style>
